import {
  LeftOutlined,
  SwapRightOutlined,
  SearchOutlined,
} from "@ant-design/icons";
import Styles from "./index.module.scss";
import { getSearchLocation } from "../../reducer/param";
import store from "../../reducer";
import { observer } from "mobx-react-lite";

const Head = observer(() => {
  const location = getSearchLocation(store);
  if (!location) return;
  return (
    <div className={Styles.head}>
      <div className="left">
        <LeftOutlined></LeftOutlined>
      </div>
      <div className="mid">
        {location.from}
        <SwapRightOutlined />
        {location.to}
      </div>
      <div className="right">
        <SearchOutlined />
      </div>
    </div>
  );
});
export default Head;
